package com.cssy.yd.logic.service.impl;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSONArray;
import com.byd.acegiext.domain.User;
import com.cssy.yd.logic.dao.LogicSoCancelDAO;
import com.cssy.yd.logic.dao.LogicSoCancelItemDAO;
import com.cssy.yd.logic.dao.LogicSoReturnDAO;
import com.cssy.yd.logic.dao.LogicSoReturnItemDAO;
import com.cssy.yd.logic.dao.LogicSoWareDAO;
import com.cssy.yd.logic.dao.LogicSoWareItemDAO;
import com.cssy.yd.logic.entity.LogicSoCancelItemDO;
import com.cssy.yd.logic.entity.LogicSoReturnDO;
import com.cssy.yd.logic.entity.LogicSoReturnItemDO;
import com.cssy.yd.logic.entity.LogicSoWareDO;
import com.cssy.yd.logic.entity.LogicSoWareItemDO;
import com.cssy.yd.logic.entity.LogicWhAffDO;
import com.cssy.yd.logic.service.ILogicSoCancelItemService;
import com.cssy.yd.logic.service.ILogicSoReturnService;
import com.cssy.yd.logic.service.ILogicWhAffStockService;
import com.plat.exception.SyBaseException;
import com.plat.helper.SearchCondition;
import com.plat.helper.SearchConditions;
import com.plat.helper.SearchResult;
import com.plat.util.GlobalResLoader;
import com.plat.util.IDCodeTypeUtil;
import com.plat.util.SessionUtil;
import com.yuendong.sy.exception.SyCodeException;
import com.yuendong.sy.service.code.SyCodeType;
import com.yuendong.sy.service.code.impl.SyCodeService;

@Service("logicSoCancelItemService")
public class LogicCancelItemServiceImpl implements ILogicSoCancelItemService{
	@Resource(name = "logicSoCancelDAO")
	private LogicSoCancelDAO logicSoCancelDAO;
	
	@Resource(name = "logicSoCancelItemDAO")
	private LogicSoCancelItemDAO logicSoCancelItemDAO;
	
	@Override
	public SearchResult findListByExample(SearchConditions scs)
			throws SyBaseException {
		SearchResult rs=new SearchResult(scs);
		List<LogicSoCancelItemDO>  list=logicSoCancelItemDAO.find(scs);
		rs.setRecordCount(logicSoCancelItemDAO.count(scs));
		rs.setResults(list);
		return rs;
	}

	@Override
	public Integer delete(String id, User user) throws SyBaseException {
		Integer i =logicSoCancelItemDAO.deleteLogicSoCancelItemDOByPrimaryKey(id);
		return null;
	}

	@Override
	public Integer update(LogicSoCancelItemDO t, User user) throws SyBaseException {
		return logicSoCancelItemDAO.updateLogicSoCancelItemDO(t);
	}

	@Override
	public LogicSoCancelItemDO save(LogicSoCancelItemDO t, User user) throws SyBaseException {
		t.setId(IDCodeTypeUtil.getId());
		logicSoCancelItemDAO.insertLogicSoCancelItemDO(t);
		return t;
	}

	@Override
	public LogicSoCancelItemDO findListById(String id) throws SyBaseException {
		return logicSoCancelItemDAO.findLogicSoCancelItemDOByPrimaryKey(id);
	}

	@Override
	public Integer deleteBizRemoved(String id) throws SyBaseException {
		// TODO Auto-generated method stub
		return null;
	}
	
}
